﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ALDIOrganizer
{
    public static class UserPrivilegeExtensions
    {
        public static string[] GetRoles(this UserPrivilege pUserPrivilege)
        {
            var _result = new List<String>();
            if ((pUserPrivilege & UserPrivilege.DeletingStaff) != 0)
            {
                _result.Add(Settings.Default.ROLE_DeletingStaff);
            }
            if ((pUserPrivilege & UserPrivilege.EditingContracts) != 0)
            {
                _result.Add(Settings.Default.ROLE_EditingContracts);
            }
            if ((pUserPrivilege & UserPrivilege.EditingHolidays) != 0)
            {
                _result.Add(Settings.Default.ROLE_EditingHolidays);
            }
            if ((pUserPrivilege & UserPrivilege.EditingPastHolidays) != 0)
            {
                _result.Add(Settings.Default.ROLE_EditingPastHolidays);
            }
            if ((pUserPrivilege & UserPrivilege.EditingPastRotas) != 0)
            {
                _result.Add(Settings.Default.ROLE_EditingPastRotas);
            }
            if ((pUserPrivilege & UserPrivilege.EditingRequests) != 0)
            {
                _result.Add(Settings.Default.ROLE_EditingRequests);
            }
            if ((pUserPrivilege & UserPrivilege.EditingRotas) != 0)
            {
                _result.Add(Settings.Default.ROLE_EditingRotas);
            }
            if ((pUserPrivilege & UserPrivilege.EditingStaff) != 0)
            {
                _result.Add(Settings.Default.ROLE_EditingStaff);
            }
            if ((pUserPrivilege & UserPrivilege.EditingTemplates) != 0)
            {
                _result.Add(Settings.Default.ROLE_EditingTemplates);
            }
            if ((pUserPrivilege & UserPrivilege.ViewingStaff) != 0)
            {
                _result.Add(Settings.Default.ROLE_ViewingStaff);
            }
            if ((pUserPrivilege & UserPrivilege.ViewingRequests) != 0)
            {
                _result.Add(Settings.Default.ROLE_ViewingRequests);
            }
            



            return new string[]{};
        }        
    }
}
